﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Banner.aspx.cs" Inherits="Sbook.AdminIstrator.Banner" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="~/AdminIstrator/ControlAdmin/MenuLeft.ascx" TagName="MenuLeft"
    TagPrefix="UC" %>
<%@ Register Src="ControlAdmin/ucLogout.ascx" TagName="ucLogout" TagPrefix="uc1" %>
<%@ Register Src="ControlAdmin/MenuTop.ascx" TagName="MenuTop" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Admin System</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/ddaccordion.js"></script>
    <script type="text/javascript">
        ddaccordion.init({
            headerclass: "submenuheader", //Shared CSS class name of headers group
            contentclass: "submenu", //Shared CSS class name of contents group
            revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
            mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
            collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
            defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
            onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
            animatedefault: false, //Should contents open by default be animated into view?
            persiststate: true, //persist state of opened contents within browser session?
            toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
            togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
            animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
            oninit: function (headers, expandedindices) { //custom code to run when headers have initalized
                //do nothing
            },
            onopenclose: function (header, index, state, isuseractivated) { //custom code to run whenever a header is opened or closed
                //do nothing
            }
        })
    </script>
    <script src="js/jquery.jclock-1.2.0.js.txt" type="text/javascript"></script>
    <script type="text/javascript" src="js/jconfirmaction.jquery.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('.ask').jConfirmAction();
        });
	
    </script>
    <script type="text/javascript">
        $(function ($) {
            $('.jclock').jclock();
        });
    </script>
    <script language="javascript" type="text/javascript" src="js/niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />
    <link rel="stylesheet" type="text/css" href="css/tcal.css" />
    <script type="text/javascript" src="js/tcal.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="main_container">
        <div class="header">
            <div class="logo">
                <a href="adminsys.html">
                    <img alt="" src="../images/logo_sach.gif" width="130" height="100" />
                </a>
            </div>
            <div class="right_header">
                Welcome Admin | <uc1:ucLogout ID="ucLogout1" runat="server" />
            </div>
            <div class="jclock">
            </div>
        </div>
        <div class="main_content">
            <uc1:MenuTop runat="server" ID="menuTop" />
            <div class="center_content">
                <UC:MenuLeft runat="server" ID="MenuRight"></UC:MenuLeft>
                <!-- end of right content-->
                <div class="right_content">
                    
                    <asp:Panel runat="server" ID="pnView" Width="100%">
                        <table>
                            <tr>
                                <td>
                                    <asp:Button runat="server" ID="btnAddT" OnClick="Add_Click" Text="Thêm mới" />
                                </td>
                                <%--<td>
                                    <asp:Button runat="server" ID="btnDeleteT" Text="Xóa" />
                                </td>--%>
                            </tr>
                        </table>
                        <asp:DataGrid runat="server" ID="grBanner" Width="100%" AutoGenerateColumns="false" OnEditCommand="grdBanner_ItemCommand">
                            <AlternatingItemStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateColumn>
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblID" Text='<%#Eval("BId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                
                                <asp:TemplateColumn HeaderStyle-Width="300px"  HeaderStyle-Height="30px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <HeaderTemplate>Hình ảnh</HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Image runat="server" ID="Bimg" Width="200px" Height="100px" ImageUrl='<%#Eval("BLink") %>' />
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:BoundColumn DataField="BType" HeaderText="Nơi hiển thị" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:BoundColumn>
                                <asp:BoundColumn DataField="BStatus" ItemStyle-Width="100px" HeaderText="Trạng thái" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></asp:BoundColumn>
                                <asp:TemplateColumn ItemStyle-Width="170px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <HeaderTemplate>Chức năng</HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Button runat="server" ID="btnEdit" CommandArgument='<%#Eval("BId") %>' CommandName="Edit" Text="Sửa" />
                                        <asp:Button runat="server" ID="Button1"  OnClick="Delete_Click" OnClientClick="javascript:return confirm('Bạn muốn xóa ?');" CommandArgument='<%#Eval("BId") %>'  Text="Xóa" />
                                        <asp:Button runat="server" ID="btnActive" OnClick="Active_Click"   CommandArgument='<%#String.Format("{0}:{1}",Eval("BId"),Eval("BStatus")) %>'   Text="Ẩn" />
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                            </Columns>
                        </asp:DataGrid>
                    </asp:Panel>
                    <asp:Panel runat="server" ID="pnUpdate" Visible="false">
                        <table width="700px" style="float:left; margin-top:30px">
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblImg" Text="Hình ảnh :"></asp:Label>
                                </th>
                                <td style="width:700px">
                                    <asp:FileUpload runat="server" ID="fileBImg" Width="300px" />
                                    <asp:Label runat="server" ID="lblFile" Visible="true"></asp:Label>
                                    <asp:Image ID="BImgEdit" runat="server" Width="120px" Height="120px" />
                                    
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblType" Text="Nơi hiển thị"></asp:Label>
                                </th>
                                
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlType">
                                    </asp:DropDownList>
                                </td>
                                
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblBActive" Text="Ẩn/Hiện :"></asp:Label>
                                </th>
                                <td>
                                    <asp:CheckBox runat="server" ID="chkBActive" />
                                </td>
                            </tr>
                              <tr style="margin-top: 20px; float: left">
                                <td  style="width:150px">
                                    <asp:Button runat="server" ID="btnSaveB" OnClick="Save_Click" Text="Save" />
                                    
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnBackB" OnClick="Back_Click" Text="Back" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </div>
            <!--end of center content -->
            <div class="clear">
            </div>
        </div>
        <!--end of main content-->
        <div class="footer">
            <div class="left_footer">
                SBook 2012</div>
        </div>
    </div>
    </form>
</body>
</html>
